home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / IDE / SUBARTIC / SUB_ARCT / CONSTRAI / VALUE_PR.JAV < prev   
Encoding:
Text File  |  1996-10-04  |  3.6 KB  |  94 lines

  1.  
  2. package sub_arctic.constraints;
  3.  
  4. /** 
  5.  * An interface for objects that provide values within the "external value"
  6.  * system.  This system bridges the lightweight constraint system to 
  7.  * external entities -- either to non-local dependents, to heavyweight 
  8.  * constraints, or to "application" objects.  Value_provider objects can 
  9.  * maintain several values (parts) which are selected via a unique integer 
  10.  * designator.  Value_providers are responsible for notifying a set of 
  11.  * value_consumer objects that have registered interest whenever one of 
  12.  * these values changes.
  13.  *
  14.  * @author Scott Hudson
  15.  */
  16. public interface value_provider {
  17.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  18.  
  19.   /** 
  20.    * Get an up-to-date copy of (or reference to) a particular value.  All 
  21.    * values must be Objects.  If you need to pass a builtin type (e.g., int), 
  22.    * use the corresponding Object form (e.g., Integer).<p>
  23.    *
  24.    * @param int part_number the part number whose value is being requested.
  25.    * @return Object an object holding the up-to-date value of that part.
  26.    */
  27.    public Object get_value(int part_number);
  28.      //   later we should probably provide separate methods for primitive types
  29.      //   these can by default throw a bad type exception 
  30.  
  31.    //had:
  32.    //* @exception bad_value if an invalid part number is given.
  33.  
  34.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  35.  
  36.   /** 
  37.    * Register something as interested in (dependent on) one of the parts of 
  38.    * this object.  The entity registered is a part within a value_consumer 
  39.    * object.  Whenever a value represented by this part of this value_provider 
  40.    * changes (or might change), the value_ood() method must be invoked on each 
  41.    * currently registered (object,part).  <p>
  42.    *
  43.    * @param int            on_part_num number of our part.
  44.    * @param value_consumer dep_obj     the object that uses that part.
  45.    * @param int            dep_part    the part within that object that uses 
  46.    *                                   our part.
  47.    */
  48.   public void attach_dependent(
  49.     int            on_part_num, 
  50.     value_consumer dep_obj, 
  51.     int            dep_part);
  52.  
  53.    //had:
  54.    //* @exception bad_value if an invalid part number is given.
  55.    //* @exception general
  56.  
  57.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  58.  
  59.   /** 
  60.    * Remove an (object,part) pair from the dependent (interested in) list. <p>
  61.    *
  62.    * @param int            on_part_num number of our part.
  63.    * @param value_consumer dep_obj     the object that formerly used that part.
  64.    * @param int            dep_part    the part within that object that 
  65.    *                                   formerly used our part.
  66.    */
  67.   public void detach_dependent(
  68.     int            on_part_num, 
  69.     value_consumer dep_obj, 
  70.     int            dep_part);
  71.  
  72.    //had:
  73.    //* @exception bad_value if an invalid part number is given.
  74.  
  75.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  76. }
  77.   
  78. /*=========================== COPYRIGHT NOTICE ===========================
  79.  
  80. This file is part of the subArctic user interface toolkit.
  81.  
  82. Copyright (c) 1996 Scott Hudson and Ian Smith
  83. All rights reserved.
  84.  
  85. The subArctic system is freely available for most uses under the terms
  86. and conditions described in 
  87.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  88. and appearing in full in the lib/interactor.java source file.
  89.  
  90. The current release and additional information about this software can be 
  91. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  92.  
  93. ========================================================================*/
  94.